package com.example.home.adapter

import androidx.fragment.app.Fragment
import androidx.fragment.app.FragmentManager
import androidx.lifecycle.Lifecycle
import androidx.viewpager2.adapter.FragmentStateAdapter
import com.example.home.view.HomeListFragment

class HomeViewPageAdapter(val fragments:MutableList<HomeListFragment> = mutableListOf(), val f: FragmentManager, lifecycle: Lifecycle):
    FragmentStateAdapter(f,lifecycle) {
    override fun getItemCount(): Int  = fragments.size

    override fun createFragment(position: Int): Fragment =fragments[position]

    override fun getItemId(position: Int): Long = position.toLong()

    override fun getItemViewType(position: Int): Int  = position
}